package com.github.cakin.shiro.chapter23.entity;

import java.io.Serializable;

/**
 * @className: App
 * @description: App实体
 * @date: 2020/6/1
 * @author: cakin
 */
public class App implements Serializable {
    /**
     * 主键
     */
    private Long id;
    /**
     * App名称
     */
    private String name;
    /**
     * App键
     */
    private String appKey;
    /**
     * App密码
     */
    private String appSecret;
    /**
     * 应用是否可用
     */
    private Boolean available = Boolean.FALSE;

    public Long getId() {
        return id;
    }

    public void setId( Long id ) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName( String name ) {
        this.name = name;
    }

    public String getAppKey() {
        return appKey;
    }

    public void setAppKey( String appKey ) {
        this.appKey = appKey;
    }

    public String getAppSecret() {
        return appSecret;
    }

    public void setAppSecret( String appSecret ) {
        this.appSecret = appSecret;
    }

    public Boolean getAvailable() {
        return available;
    }

    public void setAvailable( Boolean available ) {
        this.available = available;
    }

    @Override
    public boolean equals( Object o ) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }

        App app = (App) o;

        if (id != null ? !id.equals(app.id) : app.id != null) {
            return false;
        }

        return true;
    }

    @Override
    public int hashCode() {
        return id != null ? id.hashCode() : 0;
    }

    @Override
    public String toString() {
        return "App{"
                + "id=" + id
                + ", name='" + name + '\''
                + ", appKey='" + appKey + '\''
                + ", appSecret='" + appSecret + '\''
                + ", available=" + available
                + '}';
    }
}
